<?php
/**
 * 处理性格的主题，每个性格为一个主题，
 * 可以理解为一个性格一个订阅
 * @author Administrator
 * @create 2013-4-19 11:08:59
 */
class Subscribe_Push_Subject_One extends Subscribe_Push_Subject_Abstract
{
	public function dealTrigger()
	{
		$criteriaObj = new Subscribe_Push_Criteria();
		$stockObj = new Subscribe_Push_Stock();
		$style = 1;
		$allStock = $stockObj->getAllAlertStock($style);
		foreach ($allStock as $stock) {
			$currentPrice = $stockObj->getCurrentPrice($stock['code']);
			$result = $criteriaObj->isInRange($currentPrice, $stock);
			if ($result['isInRange']) {
				$this->_change = $result;
				$this->_style = $style;
				$this->notifyObserver();
			}
		}
	}
}